<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>
  
</head>

<body>

  <%@ include file="/WEB-INF/include/header.jsp"%>
  
  <%@ include file="/WEB-INF/include/menu.jsp"%>
  
  <div class="container main-content">
  
    <div class="panel panel-default x-panel x-panel-layout">
    
       <div class="panel-heading">
        <ol class="breadcrumb">
          <li><a href="${ctx.host}/finance">财务管理</a></li>
          <li class="active">存货档案</li>
        </ol>
      </div>
    
      <div class="panel-body">
      
        <div class="col-xs-2 x-panel-layout-left no-horizontal-padding">
          <%@ include file="/WEB-INF/include/submenu.jsp"%>
        </div>
      
        <div class="col-xs-10 x-panel-layout-right">
          <div class="x-breadcrumb-wrapper">
            <div class="x-breadcrumb clearfix">
              <h2><i class="glyphicon glyphicon-fire"></i>&nbsp;&nbsp;<span>存货档案&nbsp;-&nbsp;产品列表</span></h2>
            </div>
            
            <div class="x-breadcrumb-wrapper top-margin-20" style="position: relative;">
              <ul class="nav nav-pills x-breadcrumb-nav">
                <li class="pull-left ${!export ? 'active' : ''}"><a href="${ctx.host}/inventory-files?export=false">未导出</a></li>
                <li class="pull-left ${export ? 'active' : ''}"><a href="${ctx.host}/inventory-files?export=true">已导出</a></li>
              </ul>
            </div>
          </div>
          
          <div class="x-toolbar-wrapper top-margin-20 clearfix">
            <div class="btn-group pull-right">
              <c:if test="${!export}">
                <a href="${ctx.host}/inventory-files/export-view" data-target="#inventory-export" data-toggle="modal" title="导出数据" class="btn btn-default x-btn btn-shadow btn-shadow-default">
                  <i class="glyphicon glyphicon-search"></i>&nbsp;&nbsp;导出数据
                </a>
              </c:if>
            </div>
          </div>
          
          <table class="table table-striped table-hover x-table bottom-margin-20">
            <thead>
              <tr>
                <th>存货编码</th>
                <th>存货名称</th>
                <th>存货大类编码</th>
                <th>计量单位组编码</th>
                <th>主计量单位编码</th>
              </tr>
            </thead>
            <tbody>
              <c:forEach var="product" items="${products}">
                <tr>
                  <td>${product.type.online ? 'RMJZXS' : product.type.offline ? 'RMJZXX' : 'RMJZDS'}${product.id}</td>
                  <td>${product.name}</td>
                  <td>${product.type.online ? 'RMJZXS' : product.type.offline ? 'RMJZXX' : 'RMJZDS'}</td>
                  <td>${product.course.year ? '01' : '00'}</td>
                  <td>
                    <c:choose>
                      <c:when test="${product.course.individual}">19</c:when>
                      <c:when test="${product.course.online}">25</c:when>
                      <c:when test="${product.course.year}">31</c:when>
                      <c:otherwise>15</c:otherwise>
                    </c:choose>
                  </td>
                </tr>
              </c:forEach>
            </tbody>
          </table>
          
          <div class="form-horizontal clearfix">
            
          <jsp:include page="/WEB-INF/include/page.jsp">
            <jsp:param name="url" value="inventory-files" />
            <jsp:param name="queryString" value="${queryString}" />
          </jsp:include>
          
          </div>
          
        </div>
      </div>
    </div>
  </div>
  
  <%@ include file="/WEB-INF/include/script.jsp"%>
  
</body>
</html>